﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JsStatic.aspx.cs" Inherits="JsStatic" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="jquery-1.6.2.js" type="text/javascript"></script>
    <script type="text/javascript">
        //构造函数式的声明类
        
//        function Myclass() {
//            this.name = "default";
//            this.setName = function (name) {
//                this.name = name;
//            };
//            this.getName = getName;
//            this.call = function () {
//                alert("lady gaga")
//            };
//        }
//        function getName() {
//            alert(this.name);
//        }

//        var m1 = new Myclass();
//        m1.setName("夏华");
//        m1.getName();
//        var m2 = new Myclass();
//        m2.setName("张雪飞");
//        m2.getName();
//        m2.call();
        //        getName();
        function o() {
            this.name = "";
            this.setName = function (name) {
                this.name = name;
            }
            this.call = function () {
                alert(this.name);
            }
        };

        o.static = function () {
            alert("我叫静态函数");
        }

        o.static();
        
//        o.call();
        var o1 = new o();
        o1.setName("xia");
        o1.call();

        var o2 = new o();
        o2.setName("hua");
        o2.call();
        o2.static();

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
</body>
</html>
